Avorion Script API Documentation
Alliance [Server] Callbacks
IMPORTANT Note: Alliances can be unloaded from RAM and saved to hard disk when no members are active and no sectors containing their ships are loaded in RAM. When an alliance is unloaded to hard disk, all its callbacks will be silently terminated. Due to technical reasons, this cannot be avoided. You should only register callbacks to Alliances when you know that they won't be unloaded.
Those situations are:
- In Player scripts when that player is a member
- Alliance entity scripts
- Alliance scripts
- Client scripts when local player is in an alliance
Note: Callbacks have to be buffered in certain situations and won't happen immediately. When unregistering a callback during a callback, all callbacks that were buffered during the last frame may still be sent, even though they were unregistered.
callback onAutoPayCrewsChanged(autoPayCrews)
Called whenever the auto-pay-crews property was changed
Parameters
callback onHomeSectorChanged(x, y)
Called whenever the home sector of the alliance changes
Parameters
y The y coordinate of the new home sector
callback onItemAdded(item, index, amount, amountBefore, tagsChanged)
Called whenever an item in the alliance inventory is added
Parameters
index Index of the inventory item
amount Amount of items in the slot
amountBefore Amount of items in the slot before the change
tagsChanged Boolean indicating if the tags of the item changed
callback onItemChanged(item, index, amount, amountBefore)
Called whenever an item in the alliance inventory changes
Parameters
index Index of the inventory item
amount Amount of items in the slot
amountBefore Amount of items in the slot before the change
callback onItemPropertiesChanged(item, index, amount)
Called whenever an item in the alliance inventory changes properties
Parameters
index Index of the inventory item
amount Amount of items in the slot
callback onItemRemoved(item, index, amount, amountBefore)
Called whenever an item in the alliance inventory is removed
Parameters
index Index of the inventory item
amount Amount of items in the slot
amountBefore Amount of items in the slot before the change
callback onKnownSectorAdded(x, y)
Called whenever a new tracked sector is added to the alliance database
Parameters
y The y coordinate of the sector
callback onKnownSectorRemoved(x, y)
Called whenever a tracked sector was removed from the alliance database
Parameters
y The y coordinate of the sector
callback onKnownSectorUpdated(x, y)
Called whenever a tracked sector is updated in the alliance database
Parameters
y The y coordinate of the sector
callback onLeaderChanged(index)
Called whenever the leader of the alliance was changed
Parameters
callback onMemberChanged(index, rank)
Called whenever a member is changed in the alliance
Parameters
rank The rank of the member
callback onMemberLeft(index)
Called whenever a member leaves the alliance
Parameters
callback onMessageOfTheDayChanged(motd)
Called whenever the message of the day was changed
Parameters
callback onNameChanged(newName)
Called whenever the name of the alliance changes
Parameters
callback onNewbieRankChanged(name)
Called whenever the newbie rank was changed
Parameters
callback onNewMember(index, rank)
Called whenever a new member joins the alliance
Parameters
rank The rank of the new member
callback onNewRank(name, icon, level, privileges)
Called whenever a new rank is added
Parameters
icon The icon of the rank
level The level of the rank
privileges The privileges of the rank, as a table with privileges as keys
callback onRankChanged(name, icon, level, privileges)
Called whenever a rank is changed
Parameters
icon The icon of the rank
level The level of the rank
privileges The privileges of the rank, as a table with privileges as keys
callback onRankRemoved(name)
Called whenever a rank was removed
Parameters
callback onRelationChanged(index, level, levelBefore, notify)
Called whenever relations of the alliance to another faction change
Parameters
level The level of the relation
levelBefore The level of the relation before the change
notify A boolean indicating whether or not the alliance should be notified about the change
callback onRelationLevelChanged(index, level, levelBefore, notify)
Called whenever relation levels of the alliance to another faction change
Parameters
level The level of the relation
levelBefore The level of the relation before the change
notify A boolean indicating whether or not the alliance should be notified about the change
callback onRelationStatusChanged(index, status, statusBefore, notify)
Called whenever the relation status of the alliance to another faction change (relation status is not yet implemented so this callback will most likely not fire until relation status is in)
Parameters
status The status of the relations
statusBefore The status of the relation before the change
notify A boolean indicating whether or not the alliance should be notified about the change
callback onResourcesChanged(money, resources, infinite, notify)
Called whenever the amount of money or resources of the alliance changes
Parameters
resources The amount of resources the alliance owns, as table
infinite True if the alliance has infinite resources, false otherwise
notify A boolean indicating whether or not the alliance should be visually notified in some way that the resources changed
callback onScriptAdded(allianceIndex, scriptIndex, scriptPath)
Executed after a script was added to the alliance
Parameters
scriptIndex The index of the script that was added
scriptPath The path of the old script
callback onScriptRemoved(allianceIndex, oldScriptIndex, scriptPath)
Executed after a script was removed from the alliance
Parameters
oldScriptIndex The old index of the script that was removed
scriptPath The path of the old script
callback onShipAvailabilityUpdated(name, availability)
Called whenever a ShipInfo changes availability status (ie. goes into background simulation)
Parameters
availability The new availability status of the ship
callback onShipCargoUpdated(name)
Called whenever the cargo of a ShipInfo changes
Parameters
callback onShipCrewUpdated(name)
Called whenever the crew of a ShipInfo changes
Parameters
callback onShipHyperspacePropertiesUpdated(name, reach, canPassRifts)
Called whenever the hyperspace reach of a ShipInfo changes
Parameters
reach The new reach of the ship
canPassRifts A boolean indicating whether the ship can jump across rifts
callback onShipIconUpdated(name, icon)
Called whenever the icon of a ShipInfo changes
Parameters
icon The new icon of the ship
callback onShipInfoAdded(name)
Called whenever a ShipInfo is added to the alliance
Parameters
callback onShipInfoRemoved(name)
Called whenever a ShipInfo is removed from the alliance
Parameters
callback onShipInfoUpdated(name)
Called whenever a ShipInfo is updated in some way
Parameters
callback onShipNameUpdated(name, newName)
Called whenever the name of a ShipInfo changes
Parameters
newName The new name of the ship
callback onShipOrderInfoUpdated(name, orderInfo)
Called whenever the order info of a ShipInfo changes
Parameters
orderInfo The order info of the ship
callback onShipPayDayUpdated(name, time)
Called whenever the payday of a ShipInfo changes
Parameters
time The payday of the ship
callback onShipPlanUpdated(name)
Called whenever the plan of a ShipInfo changes
Parameters
callback onShipPositionUpdated(name, x, y)
Called whenever a ShipInfo changes sectors
Parameters
x The new x coordinate of the ship
y The new y coordinate of the ship
callback onShipReconstructionValueUpdated(name, value)
Called whenever the reconstruction value of a ShipInfo changes
Parameters
value The value of the ship
callback onShipStatusMessageUpdated(name, status, args)
Called whenever the status info of a ShipInfo changes
Parameters
status The status info text of the ship
args A table holding the status info localization arguments
callback onShipTitleUpdated(name)
Called whenever the title of a ShipInfo changes
Parameters
callback onShipTypeUpdated(name, type)
Called whenever the entity type of a ShipInfo changes
Parameters
type The new entity type of the ship
callback onStateFormChanged(newForm)
Called whenever the state form of the alliance changes
Parameters
callback onTraitChanged(trait, value)
Called whenever a "personality" trait of the alliance changes
Parameters
value The value of the new trait, from -1 to 1
Callbacks Alliance [Client] Callbacks Alliance [Server] Callbacks Alliance [Server] Callbacks Entity Callbacks Galaxy Callbacks Player Callbacks Player [Client] Callbacks Sector Callbacks Server Callbacks
Command Entity FactionDatabase PlanGenerator Player Sector Server UsableInventoryItem
Boarding BspTree CargoBay CargoLoot ControlUnit CrewComponent DeletionTimer DirectFlightPhysics DockingClamps DockingParent DockingPositions Durability EnergySystem Engine FighterAI Hangar HyperspaceEngine InteractionText InventoryItemLoot Owner Physics Plan ReadOnlyBoarding ReadOnlyBspTree ReadOnlyCargoBay ReadOnlyControlUnit ReadOnlyCrew ReadOnlyDeletionTimer ReadOnlyEnergySystem ReadOnlyEngine ReadOnlyFighterAI ReadOnlyHangar ReadOnlyHyperspaceEngine ReadOnlyInteractionText ReadOnlyOwner ReadOnlyPhysics ReadOnlyPlan ReadOnlyShipAI ReadOnlyShipSystem ReadOnlyTorpedoAI [Server] [Client] [Server] [Client] ReadOnlyTorpedoAI [Server] [Client] [Server] [Client] ReadOnlyTorpedoLauncher ReadOnlyTurretBases ReadOnlyVelocity ReadOnlyWeapons ReadOnlyWormHole Shield ShipAI ShipSystem StructuralIntegrity SystemUpgradeLoot Thrusters Torpedo TorpedoAI TorpedoLauncher Turret TurretAI TurretBases Velocity Weapons WormHole
AllianceMember AllianceRank BlockPlan BlockPlanBlock BlockStatistics Box Captain Color ControlUnitSeat CraftDesign CraftStatsOverview Crew CrewMan CrewProfession DebugInfo dvec2 dvec3 dvec4 Entity EntityDescriptor FighterTemplate Format GameSettings Group HighResolutionTimer Inventory InventoryTurret ivec2 ivec3 ivec4 Language Mail Material Matrix ModManager NamedFormat PlanBspTree PlanetSpecifics PlanGenerationStage PlanPart PlanStyle PlayerId PluralForm Profiler QuadTree Random Rarity Ray ReadOnlyEntity Rect Relation Scenario SectorView Seed Sphere Squad SystemUpgradeTemplate Timer Tooltip TooltipLine TorpedoShaft TorpedoTemplate TradingGood TurretDesign TurretDesignPart TurretTemplate UsableInventoryItem Uuid VanillaInventoryItem vec2 vec3 vec4 Version Weapon
EntityIcon EntityTooltip PlanMesh ReadOnlyIcon ReadOnlyPlanMesh ReadOnlyScriptUI ReadOnlyTooltip ScriptUI
Achievements Alliance [Client] CameraKeyFrame CaptainSelectionItem Client ClientSettings ColorSelectionItem CraftDesignSelectionItem Faction [Client] Galaxy [Client] GalaxyMap GameInput GlowFX IconSelectionItem InputWindow InventoryReferenceSelectionItem InventorySelectionItem Keyboard LaserFX Mouse Music PixelIconSelectionItem Planet Player [Client] PlayerWindow RefractionFX Sector [Client] SelectionItem ShipDatabaseEntry [Client] SoundSource StrategyState TargetIndicator TooltipRenderer TurretDesignSelectionItem
AllianceEmblem AllianceTab ArrowLine Button [Client] [Client] Button [Client] [Client] CaptainIcon CaptainProfile CheckBox ComboBox ContextMenu CraftPortrait CrewBar Frame Hud InventorySelection Label Line ListBox ListBoxEx MapArrowLine MapIcon MultiLineTextBox NumbersBar Picture PlanDisplayer ProgressBar SavedDesignsSelection ScrollFrame Selection ShipWindow Slider StatisticsBar Tab TabbedWindow TextBox TextField TooltipDisplayer Tree UIArbitraryHorizontalSplitter UIArbitraryVerticalSplitter UIContainer UIElement UIGridSplitter UIHorizontalLister UIHorizontalMultiSplitter UIHorizontalSplitter UIOrganizer UIRect UIRenderer UIVerticalLister UIVerticalMultiSplitter UIVerticalSplitter ValueComboBox Window
EntityTransferrer FighterController Loot ReadOnlyEntityTransferrer ReadOnlyFighterController ReadOnlyLoot ReadOnlyTurretController ReadOnlyWreckageCreator TurretController WreckageCreator
Alliance [Server] Faction [Server] Galaxy [Server] Player [Server] ReadOnlySector Sector [Server] Server ShipDatabaseEntry [Server]
AIState AlliancePrivilege BeamShape BlockShading BlockStructure BlockType BlockType2 BoxType BuildError CaptainGenderId ChatChannel ChatMessageType ComponentType ControlAction ControlActionBit ControlStyle CoolingType CraftStatsOverviewStat CrewProfessionType CrewRank DamageSource DamageType DeletionType Difficulty EntityArrivalType EntityType FighterOrders FighterStartError FighterType FontType ImpactParticles InventoryItemType JumpError KeyboardKey ListBoxEntryType MalusReason MaterialType MoonType MouseButton PlanetType PlayerStateType ProjectileShape RarityType RelationStatus SavedDesignType ScenarioType SectorChangeType ShipAvailability SoundType StatsBonuses TargetIndicatorVisuals TransformationFeature TurretAutoFireMode TurretSlotType WeaponAppearance WeaponCategory
This is the official documentation for the scripting API of Avorion. This documentation is automatically generated and not necessarily complete. Depending on the context in which functions exist, some documentation such as descriptions, return values or variable names or types may be missing.
Work in Progress. Documentation of Avorion Version: 2.5.7 c8e4beec84f7